/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.tor.st.algo.move;

import java.awt.geom.Point2D;

/**
 *
 * @author Charon
 */
public class CircularMovement extends AbstractMovement {

    private double dRadius = 100.0;

    public void setRadius(double pValue) {
        dRadius = pValue;
    }

    public double getRadius() {
        return dRadius;
    }

    @Override
    public String getMovementName() {
        return "Circular";
    }

    @Override
    public Point2D.Double calculateNewPosition(double pCurrentX, double pXIncrement, double pCurrentY, double pYIncrement) {
        //-sqrt(rad^2-x^2)
        return new Point2D.Double(pCurrentX + pXIncrement, Math.sqrt(Math.pow(dRadius, 2) - Math.pow(pCurrentX + pXIncrement, 2)));
    }

    @Override
    double calculateAscentAngel(double pXValue) {
        return 0;
    }
}
